<template>
  <div class="router-tpl">
      <button @click="homeLink">返回首页</button>
  </div>
</template>

<script>
import { useRouter } from 'vue-router'

export default {
  name: 'RouterTpl',
  setup () {
    const router = useRouter()
    const homeLink = () => {
      router.push('/')
    }

    return {
      homeLink
    }
  }
}

</script>
<style scoped lang='scss'>

</style>
